<extend name="Public/base" />

<block name="body">
    <!-- 标题栏 -->
    <div class="main-title">
        <h2>内部打赏管理</h2>
    </div>
    <div class="cf">
        <div class="fl">
            <button class="btn btn-warning" data-toggle="modal" data-target="#moneyBox">一键发钱</button>
            <a title="GPU" class="btn btn-success" href="{:U('statis')}">查看统计</a>
        </div>

        <!-- 高级搜索 -->
        <div class="search-form fr cf">
             
        </div>
    </div>
    <!-- 数据列表 -->
    <div class="data-table table-striped">
    </div>

    <div class="modal fade" id="moneyBox" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
      <div class="modal-dialog">
        <div class="modal-content">
          <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
            发放明细
            <eq name="has_gave" value="1">
            <p><font color="red">*今日已经发放过了</font></p>
            </eq>
          </div>
          <div class="modal-body">
                <div class="form-group">
                <label for="exampleInputEmail1">名单</label>
                <ul>
                    <volist name="uids" id="uid">
                    <li>uid: {$uid} | nickname: {$uid|get_nickname}</li>
                    </volist>
                </ul>
                </div>

                <div class="form-group">
                    <label for="exampleInputEmail1">发放金额</label>
                    <input type="email" class="form-control input-small" id="money" placeholder="">
                  </div>
          </div>
          <div class="modal-footer">
            <if condition="!$has_gave && $uids">
            <button type="button" class="btn btn-primary" id="submit">确定</button>
            </if>
          </div>
        </div>
      </div>
    </div>

    <script type="text/javascript">
    $('#submit').click(function () {
        var money = $('#money').val();
        if (!money){
            alert('请填写金额');
            return;
        }
        $.post("{:U('give')}", {money: money}, function (data) {
            if (data.status==1) {
                if (data.url) {
                    updateAlert(data.info + ' 页面即将自动跳转~','alert-success');
                }else{
                    updateAlert(data.info ,'alert-success');
                }
                location.reload();
            }else{
                updateAlert(data.info);
            }
        })
    });
    </script>
     
</block>

<block name="script">
    <script src="__STATIC__/thinkbox/jquery.thinkbox.js"></script>

    <script type="text/javascript">
    //搜索功能
     
    //导航高亮
    highlight_subnav('{:U('index')}');
    </script>
</block>
